<?php
namespace App\Services\Testti;
use App\Model\Testti;
use App\Services\CommonService;
use Illuminate\Support\Facades\DB;

class TesttiService extends CommonService
{
    public function sel()
    {
        $dataInfo=Testti::get(['id','name','desc','img','status','title'])->where("status","=",1)->toArray();
        if($dataInfo===array())
        {
            return $this->fail(208,'查询测试题失败');
        }
        return $this->success($dataInfo);
    }
    public function selOne($id)
    {
        $dataInfo= Testti::where("status","=",1)->find($id);
        if($dataInfo===array())
        {
            return $this->fail(208,'查询测试题失败');
        }
        return $this->success($dataInfo);

    }
}